SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
Create Procedure [dbo].[TvShow_Get_YourShows]
@UserId VARCHAR(50)
as

Select T.Id, T.Title, Count(EpisodeId) AS Episodes, T.Rating, T.BannerImage  
FROM tvshow_episodes E
inner join Tv T on T.Id = E.TvId
inner join TvShow_Directories D on T.Id = D.TypeId
WHERE SeasonId <> 0 and E.rating <> -99 And UserId = @UserId
Group By T.Id, T.Title, T.Rating, T.BannerImage
Order by T.Title ASC
GO
